<template>
  <div class="logo" v-if="!logoHidden">
    <img src="@/assets/vue.svg" alt="Logo" class="logo-img">
    <span class="logo-text" :class="{ 'text-hidden': sidebarHidden }">Admin Dashboard</span>
  </div>
</template>

<script setup lang="ts">
import { computed } from 'vue'
import { useLayoutStore } from '@/store/layout'

const layoutStore = useLayoutStore()
const logoHidden = computed(() => layoutStore.layoutSettings.logoHidden)
const sidebarHidden = computed(() => layoutStore.layoutSettings.sidebarHidden)
</script>

<style scoped lang="scss">
.logo {
  height: $logo-height;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;

  .logo-img {
    height: 24px; 
    
  }

  .logo-text {
    font-size: 13px;
    font-weight: bold;
    color: #1890ff;
    transition: opacity 0.3s, width 0.3s;
    white-space: nowrap;
    margin-left: 10px;
   

    &.text-hidden {
      opacity: 0;
      width: 0;
      overflow: hidden;
      
    }
  }
}
</style>